{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
	
});

function setAmount()
{
	var outWieght = parseFloat($('#outWieght').val());
	var outRate   = parseFloat($('#outRate').val());
	var amount    = 0;

	if(!isNaN(outWieght) && !isNaN(outRate))
	{
		amount = (outWieght * outRate);
		$('.amount').val(amount.toFixed(2));
	}
	else
	{
		$('.amount').val('');
	}
}
</script>
{/block}
{block name=body}
<span style="float:left;"><button onclick="window.close();">Close</button></span>
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post">
<input type="hidden" name="billDetailId" value="{$billDetailId}" size="5">
<table align="center" border="0" cellpadding="2" cellspacing="2" >
  <tr>
    <td align="center" class="table1" colspan="9">Bill Detail</td>
  </tr>
  <tr><td align="center" colspan="9"><hr></td></tr>
  <tr>
	  <td align="center" class="table1">Out. Date</td>
	  <td align="center" class="table1">Out. Challan</td>
	  <td align="center" class="table1">In. Challan</td>
	  <td align="center" class="table1">Material</td>
	  <td align="center" class="table1">Final Process</td>
	  <td align="center" class="table1">Quantity</td>
	  <td align="center" class="table1">Weight</td>
	  <td align="center" class="table1">Rate</td>
	  <td align="center" class="table1">Amount</td>
  </tr>
  {section name=sec loop=$detailArray}
    <tr>
      <td align="center" class="table2" NOWRAP disabled="disabled" >
      {$detailArray[sec].outDate} </td>
  	  <td align="center" class="table2"><input type="text" size="10" name="outChallenNo" id="outChallenNo" {$detailArray[sec].outChallenNo} value="{$detailArray[sec].outChallenNo}" disabled /></td>
  	  <td align="center" class="table2"><input type="text" size="10" name="inChallenNo" id="inChallenNo" {$detailArray[sec].inChallenNo} value="{$detailArray[sec].inChallenNo}" disabled   /></td>
  	  <td align="center" class="table2">
  	    <select name="materialName" id="materialId" disabled>
          <option value="">Select</option>
          {html_options values=$catmaterialArray.materialId output=$catmaterialArray.materialName selected=$detailArray[sec].materialId}
        </select>
      </td>
  	  <td align="center" class="table2">
  	    <select name="finalProcess" id="finalProcessId">
          <option value="">Select</option>
          {html_options values=$catprocessArray.finalProcessId output=$catprocessArray.finalProcessName selected=$detailArray[sec].finalProcess}
        </select>
      </td>
      <td align="right" class="table2"><input type="text" size="10" name="outQuantity" id="outQuantity" {$detailArray[sec].outQuantity} value="{$detailArray[sec].outQuantity}"/></td>
      <td align="right" class="table2"><input type="text" size="10" name="outWieght" id="outWieght" {$detailArray[sec].outWieght} value="{$detailArray[sec].outWieght}" onblur="setAmount();" /></td>
  	  <td align="right" class="table2"><input type="text" size="10" name="outRate" id="outRate" {$detailArray[sec].outRate} value="{$detailArray[sec].outRate}" onblur="setAmount();" /></td>
  	  <td align="right" class="table2"><input type="text" size="15" name="amount" class="amount" id="amount" {$detailArray[sec].amount} value="{$detailArray[sec].amount}" onblur="setAmount();" /></td>
    </tr>
  {/section}
  <tr>
    <td align="center" colspan="9" align="center" class="table1"><input type="submit" name="updateBtn" value="Update" class="button" /></td>
  </tr>	
<!--
<tr>
	<td align="right" class="table1" colspan="7">Sub Total</td>
	<td align="center" class="table2">:</td>
	<td align="right" class="table2">{$masterArray.total}</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Service Tax + Edu. Cess</td>
	<td align="center" class="table2">{$masterArray.taxInPrecentage} %</td>
	<td align="right" class="table2">{$masterArray.serviceTax}</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Round Off</td>
	<td align="center" class="table2">:</td>
	<td align="right" class="table2">{$masterArray.roundOff}</td>
</tr>
<tr>
	<td align="right" class="table1" colspan="7">Net Total</td>
	<td align="center" class="table2">:</td>
	<td align="right" class="table1">{$masterArray.netTotal}</td>
</tr>-->

</table>
</form>
{/block}


